var satisfiesConditions = function(grid) {
  const row = grid.length, col = grid[0].length;

  for (let i = 0; i < row; i++) {
    for (let j = 0; j < col; j++) {
      if (i + 1 < row) {
        if (grid[i+1][j] !== grid[i][j]) {
          return false;
        }
      };
      if (j+1 < col) {
        if (grid[i][j+1] === grid[i][j]) {
          return false;
        }
      }
    }
  }
  return true;
};

const grid =  [[1,1,1],[0,0,0]]
console.log(satisfiesConditions(grid))